package org.magi.others;

import org.junit.Test;

public class OthersTest {
    @Test
    public void testLRU() {
        LRU<Integer, Integer> cache = new LRU<>(5);
        cache.put(1, 1);
        cache.put(2, 1);
        cache.put(3, 1);
        cache.put(4, 1);
        cache.put(5, 1);
        assert cache.get(1) == 1;
        cache.put(6, 1);
        assert cache.get(1) == 1;
        assert cache.get(2) == null;
        cache.put(7, 1);
        cache.put(8, 1);
    }
}
